#pragma once

#include <filesystem>
#include <vector>
#include <string>
#include "String.h"

#include "Token.h"
#include "FilePosition.h"

#include "Element.h"

class CHeadFile
{
public:
    std::filesystem::path Path;
    C32String Content;
    std::u8string Namespace;

    void GenerateMetaFileContent();

    void ParseFile();

    std::u8string MetaHeadFileContent;
    std::u8string MetaCppFileContent;

    std::vector<std::shared_ptr<CToken>> Tokens;
    std::size_t TokenIndex=0;
    std::shared_ptr<CToken> GetCurrentToken();
    void GotoNextToken();

    std::vector<std::shared_ptr<CClassInfo>> Classes;
    std::vector<std::shared_ptr<CEnumInfo>> Enums;

    void RaiseError(SFilePosition InFilePosition,const C32String & InMessage);
    void RaiseError(std::size_t InLineIndex, std::size_t InColumnIndex, std::size_t InCharNum, const C32String & InMessage);
    void RaiseError(std::shared_ptr<CToken>, const C32String & InMessage);

    void RaiseFileError(const std::u8string & InMessage);

    std::u8string HeadFileContent;
    std::u8string CppFileContent;

    void GenerateHeadFileContent();
    void GenerateCppFileContent();

protected:
    bool bHaveStruct=false;
    bool bHaveClass=false;
    bool bHaveInterface=false;

};